package cn.virens.service.impl.platform.wxmp.menus;

import java.util.List;

import org.springframework.stereotype.Service;

import cn.virens.database.common.BaseServiceImpl;
import cn.virens.database.common.mapper.ExampleWrapper;
import cn.virens.database.mysql.mapper.wxmp.WxmpMenusButtonMapper;
import cn.virens.database.mysql.model.wxmp.WxmpMenusButton;
import cn.virens.service.inter.platform.wxmp.menus.WxmpMenusButtonService;

/**
 * 按钮管理 - wxmp_menus_button
 *
 * @author Virens
 * @since  2019-11-09
 */
@Service
public class WxmpMenusButtonServiceImpl extends BaseServiceImpl<WxmpMenusButtonMapper, WxmpMenusButton> implements WxmpMenusButtonService {

	public WxmpMenusButtonServiceImpl() {
		super(WxmpMenusButton.class);
	}

	@Override
	public int deleteByUuid(String uuid) {
		ExampleWrapper example = ExampleWrapper.of(clazz);
		example.and().andEqualTo("uuid", uuid);

		return mBaseMapper.deleteByExample(example);
	}

	@Override
	public List<WxmpMenusButton> selectByUuid(String uuid) throws Exception {
		ExampleWrapper example = ExampleWrapper.of(clazz);
		example.and().andEqualTo("uuid", uuid);

		return mBaseMapper.selectByExample(example);
	}
}
